import Vue from 'vue'
import Vuex from 'vuex'
import user from "./modules/user"
import tab from "./modules/tab"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 菜单栏是否展开
    isCollapse: false
  },
  getters: {
    // 根据是否展开获取菜单栏宽度
    siderWidth: state => state.isCollapse ? '65px' : '200px'
  },
  mutations: {
    // 切换菜单栏状态
    changeSiderState: state => state.isCollapse = !state.isCollapse
  },
  actions: {
  },
  modules: {
    user, tab
  }
})
